﻿@model NavigationModel
@using CAF.Infrastructure.Core.Collections
@{
    var selectEntityId = Model.SelectedMenuItem == null ? 0 : Model.SelectedMenuItem.EntityId;

}
@if (Model.FildMenu.Count > 0)
{
    @CreateMenu(Model.FildMenu, selectEntityId);
}
@helper CreateMenu(IList<TreeNode<MenuItem>> nodes, int menuSelector)
{
foreach (var node in nodes)
{
    var url = node.Value.GenerateUrl(this.Url);
        <li @(menuSelector == node.Value.EntityId ? "class=on" : "")><a href='@url' style='font-size:16px;'>@node.Value.Text</a></li>
}

}

